package pers.lx.crm.dao.info;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import pers.lx.crm.entiy.BaseDO;
import pers.lx.crm.entiy.info.TagDO;
import pers.lx.crm.entiy.info.TagKindDO;

import javax.swing.text.html.HTML;
import java.util.List;

/**
 * Created by lxl on 2017/2/14.
 */
@Repository
public interface TagDao {

    @Insert("insert into tag_list(tag_kind_id,name,description,required) values(#{tagKindId},#{name},#{description},#{required})")
    public void insertTag(TagDO tagDO) ;

    @Update("update tag_list set tag_kind_id=#{tagKindId},name=#{name},description=#{description},required=#{required} where id=#{id}")
    public void updateTag(TagDO tagDO) ;

    @Select("select tag_list.id,tag_list.tag_kind_id,tag_list.name,tag_list.description,tag_list.required,tag_kind.kind,tag_kind.name as type from tag_list,tag_kind where tag_list.tag_kind_id = tag_kind.id")
    public List<TagDO> selectTagListPage(TagDO tagDO) ;

    @Select("select * from tag_kind ")
    public List<TagKindDO> selectTagKindList() ;

    @Delete("delete from tag_list where id=#{id}")
    public void deleteTag(TagDO tagDO) ;
}
